/-imports
/-storage ...
/-storage/attached ...
AttachedStorage.ts
LocalStorageStorage.ts
WebSQLStorage.ts
/-typings
knockout.d.ts
websql.d.ts
stringUtils.ts
teapo.html
1
module storage.attached {
2
 
3
  /**
4
   * Implemented using different sorts of local storage options available:
5
   * localStorage, IndexedDB, WebSQL, who knows what else on IE6.
6
   */
7
  export interface AttachedStorage {
8
 
9
    getKeys(prefix: string, obj: any, callback: (error: Error) => void);
10
    populate(obj: any, callback: (error: Error) => void);
11
    update(obj: any, callback: (error: Error) => void);
12
 
13
  }
14
 
15
  export interface AttachedStorage2 {
16
 
17
    getNames(prefix: string, callback: (error: Error, objectNames: string[]) => void);
18
    populate(name: string, obj: any, callback: (error: Error) => void);
19
    update(name: string, obj: any, callback: (error: Error) => void);
20
 
21
  }
22
 
23
 
24
  export module AttachedStorage {
25
 
26
    /**
27
     * Detecting an availability of a particular storage.
28
     */
29
    export interface Initialize {
30
 
31
      (uniqueKey: string, callback: (error: Error, storage: AttachedStorage) => void, windowOverride?: typeof window);
32
 
33
    }
34
 
35
  }
36
 
37
}